package com.ruoyi.project.wenyanwen.log.task.impl;

import java.util.HashMap;
import java.util.Map;

/**
 * @author jackyshi
 */
public class TrainContext {

    Map<String, Integer> uuidMapper = new HashMap<>();

    Map<Integer, Integer> iidMapper = new HashMap<>();

    String traingDataPath = "/Users/jackyshi/Documents/training/score.txt";

    String modelPath = "/Users/jackyshi/Documents/training/slopeone.model";

    int uidSeq = 1;

    int iidSeq = 1;

    public int getUidMapperId(String uuid) {
        if (uuidMapper.containsKey(uuid)) {
            return uuidMapper.get(uuid);
        } else {
            int mapperId = getUidSeqInc();
            uuidMapper.put(uuid, mapperId);
            return mapperId;
        }
    }

    public int getIidMapperId(int iid) {
        if (iidMapper.containsKey(iid)) {
            return iidMapper.get(iid);
        } else {
            int mapperId = getIidSeqInc();
            iidMapper.put(iid, mapperId);
            return mapperId;
        }
    }

    public int getUidSeqInc() {
        return uidSeq++;
    }

    public int getIidSeqInc() {
        return iidSeq++;
    }

    public Map<String, Integer> getUuidMapper() {
        return uuidMapper;
    }

    public void setUuidMapper(Map<String, Integer> uuidMapper) {
        this.uuidMapper = uuidMapper;
    }

    public Map<Integer, Integer> getIidMapper() {
        return iidMapper;
    }

    public void setIidMapper(Map<Integer, Integer> iidMapper) {
        this.iidMapper = iidMapper;
    }

    public String getTraingDataPath() {
        return traingDataPath;
    }

    public void setTraingDataPath(String traingDataPath) {
        this.traingDataPath = traingDataPath;
    }

    public String getModelPath() {
        return modelPath;
    }

    public void setModelPath(String modelPath) {
        this.modelPath = modelPath;
    }
}
